package com.wymobilearchitecture.heade_frist.adapter;

import com.wymobilearchitecture.heade_frist.adapter.behavior.FlyBehavior;
import com.wymobilearchitecture.heade_frist.adapter.behavior.QuackBehavior;

public abstract class Duck {

    //针对实现编程
    protected void quack(){

    }

    protected void fly(){

    }

    protected abstract void display();



    //针对接口编程
    protected FlyBehavior flyBehavior;
    protected QuackBehavior quackBehavior;


    public void performFly(){
        flyBehavior.flyBehavior();
    }

    public void performQuack(){
        quackBehavior.quackBehavior();
    }


}
